<div id="header">
	<div id="hat"><div class="hat">
		<? if($customer_id > 0) { ?>
		<?=WEB_WELCOME?> &nbsp; <a href="member.html"><?=$customer_nickname?></a> &nbsp; <a href="logout.html">[<?=WEB_LOGOUT?>]</a>
		<? } else { ?>
		<a href="login.html">[<?=WEB_LOGIN?>]</a> &nbsp; <a href="register.html">[<?=WEB_REGISTER?>]</a>
		<? } ?>
		 &nbsp; | &nbsp; <a href="myorder.html"><?=WEB_MY_ORDER?></a> &nbsp; | &nbsp; <a href="wish.html"><?=WEB_MY_COLLECTION?></a> &nbsp; | &nbsp; <a href="helps.html"><?=WEB_HELP_CENTER?></a> &nbsp; | &nbsp; <a href="contactus.html"><?=WEB_CONTACT_US?></a>
	</div></div>
	<div class="header">
		<div id="logo"><div class="logo"><a href="./"><img src="upload/<?=LOGO?>" /></a></div></div>
		<div id="searchbox">
			<div class="searchbox">
				<form method="get" action="search.php" onsubmit="return search()">
					<input type="text" name="s" class="search-text" maxlength="100" value="<?=(isset($s)?$s:"")?>" id="search-kwd" /><input type="submit" class="search-button hand" value=" " />
				</form>
			</div>
			<? 
				$str='';
				foreach($arr_keyword as $val){
					$str.='<a href="search.php?s='.$val.'">'.$val.'</a>';
				}
			?>
			<div class="searchtip"><?=WEB_HOT_SEARCH.$str?></div>
		</div>
		<div id="toolbox">
			<div class="toolbox">
				<div class="tooler left"><a><?=$lang_name?></a><i></i>
					<div class="toolout">
						<div class="toollang">
							<ul>
							<?
								$str='';
								foreach($arrlang as $val){
									$str.='<li><a onclick="set_lang(\''.$val['code'].'\','.$val['default_currency_id'].')">'.$val['name'].'</a></li>';
								}
								echo $str;
							?>
							</ul></div>
					</div>
				</div>
				<div class="tooler left"><a href=""><?=WEB_CURRENCY?> <?=$currency_code?></a><i></i>
					<div class="toolout">
						<div class="toollang">
							<ul>
								<?
								$str='';
								foreach($arrcurrency as $val){
									$str.='<li><a onclick="set_currency('.$val['id'].')">'.$val['code'].' '.$val['sign'].'</a></li>';
								}
								echo $str;
							?>
							</ul></div>
					</div>
				</div>
				<div class="tooler left"><a href="cart.html" class="red"><?=WEB_CART?>(<span id="cart_qty"><?=$cart_qty?></span>)</a><i></i>
					<div class="toolout">
						<div class="toolcart">
							<? if($cart_qty==0){ ?>
							<div class="emptycart"><a href="./" class="block"><span>&nbsp;</span><?=WEB_CART_IS_EMPTY?></a></div>
							<?	}
								else {
								// 遍历购物车中的商品
									$str='<div class="cart_mini"><table>';
									foreach ($cart as $val){
										$tem_pic=$cart_pro[$val['pid']]['small_pic'];
										$tem_link='product-'.$val['pid'].'.html';
										$tem_name=str_cut($cart_pro[$val['pid']]['name_'.$lang],PRODUCT_TITLE_DISPLAY_LENGTH,$lang);
										//$tem_price=round($cart_pro[$val['pid']]['price']*$currency_rate,2);
										$tem_price=price($cart_pro[$val['pid']]);
										// variation
										$str_var='';
										if($val['var']){
											$tem_var=$product_variation->get_row($val['var']);
											//$tem_price=round($tem_var['price']*$currency_rate,2); // var
											$tem_price=price($tem_var,1);
											if($tem_var['size']) $str_var.=$option_label[2].': '.$option_value[$tem_var['size']].' &nbsp; ';
											if($tem_var['color']) $str_var.=$option_label[1].': '.$option_value[$tem_var['color']].' &nbsp; ';
											if($tem_var['other1']) $str_var.=$option_label[3].': '.$option_value[$tem_var['other1']].' &nbsp; ';
											if($tem_var['other2']) $str_var.=$option_label[4].': '.$option_value[$tem_var['other2']].' &nbsp; ';
										}

										$str.='<tr><td width="260"><div class="cart_img left"><a href="'.$tem_link.'"><img src="'.PRODUCT_PIC_HOST.$tem_pic.'" width="48"></a></div><div class="cart_name right"><a href="'.$tem_link.'">'.$tem_name.'</a><br /><br /><span class="gray">'.$str_var.'</span></div></td><td><span class="red">'.$currency_sign.$tem_price.'</span> x '.$val['qty'].'</td></tr>';
									}
									$str.='</table></div>';
									echo $str;
								}
							?>
					</div>
				</div>
				<div class="clear"></div>
			</div>
		</div>
		<div class="clear"></div>
	</div>
	</div><!-- .headr end -->
</div><!-- #headr end -->
<div id="nav">
	<div class="nav <? echo $lang ?>">
		<ul>
		<li class="f"><a href="category.html"><?=WEB_ALL_PRODUCTS?></a></li>
		<li class="a best_seller"><a href="best_seller.html"><?=WEB_HOT_ITEMS?></a></li>
		<li class="a new_products"><a href="new_products.html"><?=WEB_NEW_ARRIVAL?></a></li>
		<li class="a featured_products"><a href="featured_products.html"><?=WEB_FEATURED_PRODUCTS?></a></li>
		<li class="a nnews"><a href="news.html"><?=WEB_NEWS_CENTER?></a></li>
		<li class="a naboutus"><a href="aboutus.html"><?=WEB_ABOUT_US?></a></li>
		<li class="a ncontactus"><a href="contactus.html"><?=WEB_CONTACT_US?></a></li>
		</ul>
		<div class="clear"></div>
	</div>
</div><!-- #nav end --><div class="clear"></div>